<?php echo $this->Html->script('JqueryUser'); ?>
<div class="users index">
	<h2><?php echo __('Users'); ?></h2>
	<table cellpadding="0" cellspacing="0" id="usersearch" class="search">
	<thead>
	<tr>

			<th><?php echo $this->Paginator->sort('User ID'); ?></th>
			<!--<th><?php echo $this->Paginator->sort('password'); ?></th>-->
			<th><?php echo $this->Paginator->sort('contact_id'); ?></th>
			<th><?php echo $this->Paginator->sort('permission'); ?></th>
			 <th><?php echo $this->Paginator->sort('start_date'); ?></th>
			 <th><?php echo $this->Paginator->sort('end_date'); ?></th>
			<th><?php echo $this->Paginator->sort('cert_of_appreciation'); ?></th>
			<th></th>
	</tr>
	</thead>
     <tbody>
     <?php
                             if (!empty($users)){
                                 foreach ($users as $user):
                             ?>
	<tr>
		<td><?php echo $this->Html->link($user['User']['username'], array('controller' => 'users', 'action' => 'view', $user['User']['id'])); ?></td>
		<!--<td><?php echo h($user['User']['password']); ?>&nbsp;</td>-->
		<td>
			<?php echo $this->Html->link($user['Contact']['first_name']." ".$user['Contact']['middle_name']." ".$user['Contact']['last_name'], array('controller' => 'contacts', 'action' => 'view', $user['Contact']['id'])); ?>
		</td>
		<td><?php echo h($user['Permission']['name']); ?>&nbsp;</td>
		 <td><?php echo h($user['User']['start_date']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['end_date']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['cert_of_appre']); ?>&nbsp;</td>
	    </tr>
        <?php
                                endforeach;
                            }else{
                            ?>
                            <tr>
                                <td>No Data Found</td>
                            </tr>
                            <?php }?>
	    </tbody>
        </table>
            <p>
					<p>
                               <div class="addbuttons">
								<ul>
								<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
								</ul>
							</div>

                    </div>
